from django.conf.urls import url
from . import views
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    # /users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUserNameView.as_view(),name='usernamecount'),
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count',views.RegisterPhoneView.as_view(),name='pnonecount'),
    url(r'^$',views.RegisterCreateView.as_view(),name='register'),
    # 定义登录的url,
    # users/auths
    # ObtainJSONWebToken.as_view()
    # obtain_jwt_token 这个视图可以实现对用户名和密码的校验
    url(r'^auths/$',obtain_jwt_token,name='auths'),
    # /users/infos/
    url(r'^infos/$',views.UserCenterInfo2View.as_view(),name='centerinfo'),
    # 更新邮箱/users/emails/
    url(r'^emails/$',views.EmailUpdateView.as_view(),name='emails'),
    # 邮箱激活/users/emails/verification
    url(r'^emails/verification/',views.VerifyEmailView.as_view(),name='active')
]